package com.example.springstudy.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.springstudy.dao.dto.RoleDto;
import com.example.springstudy.utils.DateUtils;
import com.example.springstudy.utils.SecurityUtils;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

import static net.sf.jsqlparser.util.validation.metadata.NamedObject.role;

@TableName("role")
@Data
@NoArgsConstructor
public class Role {
    private Integer id;
    private String name;
    private String code;
    private Integer sort;
    private Integer status;

    @TableField("create_by")
    private Long createBy;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_by")
    private Long updateBy;

    @TableField("update_time")
    private Date updateTime;

    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private Long userId;

    public Role(RoleDto roleDto) {
        this.id = roleDto.getId();
        this.name = roleDto.getName();
        this.code = roleDto.getCode();
    }
}
